# -*- coding: utf-8 -*-
"""
@Author: Rengar
@e-mail: rengar.fan@amutec.cn
@Date: 2024/10/11 
@Desc:
"""
import sys


def get_standard_encoding(stream):
    """
    获取stream或系统的编码
    :param stream:
    :return:
    """
    return getattr(stream, "encoding", None) or sys.getfilesystemencoding()
